// BCTinettiBalPage.cpp : implementation file
//

#include "stdafx.h"
#include "BCTinettiBalPage.h"
#include "../Frame/GYWalkAidApp.h"
#include "../Common/CommonFun.h"
#include "../Common/LinkComboBox.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

static INPUT_FIELD_INFO s_InputFieldArray1[] = 
{
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("10"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("20"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("30"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("40"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("50"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("60"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("70"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("80"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("90"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("100"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("110"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("120"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("130"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("140"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("150"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("160"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("170"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("180"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("190"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("200"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("210"),		ftString,	FALSE,	0,	2,		NULL,		NULL	},
};

static INPUT_FIELD_INFO s_InputFieldArray2[] = 
{
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("10"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("20"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("30"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("40"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("50"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("60"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("70"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("80"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("90"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("100"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("110"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("120"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("130"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("140"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("150"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("160"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("170"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("180"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("190"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("200"),		ftString,	FALSE,	0,	1,		NULL,		NULL	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("210"),		ftString,	FALSE,	0,	2,		NULL,		NULL	},
};

static INPUT_FIELD_INFO s_InputFieldArray3[] = 
{
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("10"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("20"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("30"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("40"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("50"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("60"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("70"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("80"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("90"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("100"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("110"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("120"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("130"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("140"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("150"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("160"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("170"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("180"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("190"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	FALSE,	TRUE,	_T("200"),		ftString,	FALSE,	0,	1,		CBCTinettiBalPage::ScoreFieldsCheck,	CBCTinettiBalPage::ScoreFieldsCheck	},
	{NULL,		IBT_NoneType,	TRUE,	TRUE,	_T("210"),		ftString,	FALSE,	0,	2,		NULL,									NULL	},
};


/////////////////////////////////////////////////////////////////////////////
// CBCTinettiBalPage dialog


CBCTinettiBalPage::CBCTinettiBalPage(CWnd* pParent, BOOL bBigRes) : CScrollPage(bBigRes ? CBCTinettiBalPage::IDD : CBCTinettiBalPage::SD_IDD, pParent)
, m_edtTine101(&m_InputFieldArray1[0]),		m_edtTine201(&m_InputFieldArray2[0]),	m_cmbTine301(&m_InputFieldArray3[0])
, m_edtTine102(&m_InputFieldArray1[1]),		m_edtTine202(&m_InputFieldArray2[1]),	m_cmbTine302(&m_InputFieldArray3[1])
, m_edtTine103(&m_InputFieldArray1[2]),		m_edtTine203(&m_InputFieldArray2[2]),	m_cmbTine303(&m_InputFieldArray3[2])
, m_edtTine104(&m_InputFieldArray1[3]),		m_edtTine204(&m_InputFieldArray2[3]),	m_cmbTine304(&m_InputFieldArray3[3])
, m_edtTine105(&m_InputFieldArray1[4]),		m_edtTine205(&m_InputFieldArray2[4]),	m_cmbTine305(&m_InputFieldArray3[4])
, m_edtTine106(&m_InputFieldArray1[5]),		m_edtTine206(&m_InputFieldArray2[5]),	m_cmbTine306(&m_InputFieldArray3[5])
, m_edtTine107(&m_InputFieldArray1[6]),		m_edtTine207(&m_InputFieldArray2[6]),	m_cmbTine307(&m_InputFieldArray3[6])
, m_edtTine108(&m_InputFieldArray1[7]),		m_edtTine208(&m_InputFieldArray2[7]),	m_cmbTine308(&m_InputFieldArray3[7])
, m_edtTine109(&m_InputFieldArray1[8]),		m_edtTine209(&m_InputFieldArray2[8]),	m_cmbTine309(&m_InputFieldArray3[8])
, m_edtTine110(&m_InputFieldArray1[9]),		m_edtTine210(&m_InputFieldArray2[9]),	m_cmbTine310(&m_InputFieldArray3[9])
, m_edtTine111(&m_InputFieldArray1[10]),	m_edtTine211(&m_InputFieldArray2[10]),	m_cmbTine311(&m_InputFieldArray3[10])
, m_edtTine112(&m_InputFieldArray1[11]),	m_edtTine212(&m_InputFieldArray2[11]),	m_cmbTine312(&m_InputFieldArray3[11])
, m_edtTine113(&m_InputFieldArray1[12]),	m_edtTine213(&m_InputFieldArray2[12]),	m_cmbTine313(&m_InputFieldArray3[12])
, m_edtTine114(&m_InputFieldArray1[13]),	m_edtTine214(&m_InputFieldArray2[13]),	m_cmbTine314(&m_InputFieldArray3[13])
, m_edtTine115(&m_InputFieldArray1[14]),	m_edtTine215(&m_InputFieldArray2[14]),	m_cmbTine315(&m_InputFieldArray3[14])
, m_edtTine116(&m_InputFieldArray1[15]),	m_edtTine216(&m_InputFieldArray2[15]),	m_cmbTine316(&m_InputFieldArray3[15])
, m_edtTine117(&m_InputFieldArray1[16]),	m_edtTine217(&m_InputFieldArray2[16]),	m_cmbTine317(&m_InputFieldArray3[16])
, m_edtTine118(&m_InputFieldArray1[17]),	m_edtTine218(&m_InputFieldArray2[17]),	m_cmbTine318(&m_InputFieldArray3[17])
, m_edtTine119(&m_InputFieldArray1[18]),	m_edtTine219(&m_InputFieldArray2[18]),	m_cmbTine319(&m_InputFieldArray3[18])
, m_edtTine120(&m_InputFieldArray1[19]),	m_edtTine220(&m_InputFieldArray2[19]),	m_cmbTine320(&m_InputFieldArray3[19])
, m_edtTine121(&m_InputFieldArray1[20]),	m_edtTine221(&m_InputFieldArray2[20]),	m_edtTine321(&m_InputFieldArray3[20])
{
	//{{AFX_DATA_INIT(CBCTinettiBalPage)
	// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	
	LPVOID pCtrl = NULL;
	DWORD dwControlType = IBT_NoneType;
	for(int i = 0; i < INPUT_EDIT_CTRL_COUNT; i++)
	{
		pCtrl = m_InputFieldArray1[i].pLinkCtrl;
		dwControlType = m_InputFieldArray1[i].dwCtrlType;
		memcpy(&m_InputFieldArray1[i], &s_InputFieldArray1[i], sizeof(INPUT_FIELD_INFO));
		m_InputFieldArray1[i].pLinkCtrl = pCtrl;
		m_InputFieldArray1[i].dwCtrlType = dwControlType;
		
		pCtrl = m_InputFieldArray2[i].pLinkCtrl;
		dwControlType = m_InputFieldArray2[i].dwCtrlType;
		memcpy(&m_InputFieldArray2[i], &s_InputFieldArray2[i], sizeof(INPUT_FIELD_INFO));
		m_InputFieldArray2[i].pLinkCtrl = pCtrl;
		m_InputFieldArray2[i].dwCtrlType = dwControlType;
		
		pCtrl = m_InputFieldArray3[i].pLinkCtrl;
		dwControlType = m_InputFieldArray3[i].dwCtrlType;
		memcpy(&m_InputFieldArray3[i], &s_InputFieldArray3[i], sizeof(INPUT_FIELD_INFO));
		m_InputFieldArray3[i].pLinkCtrl = pCtrl;
		m_InputFieldArray3[i].dwCtrlType = dwControlType;
	}
}

void CBCTinettiBalPage::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBCTinettiBalPage)
	DDX_Control(pDX, IDC_EDIT_SCORE1, m_edtTine101);
	DDX_Control(pDX, IDC_EDIT_SCORE49, m_edtTine102);
	DDX_Control(pDX, IDC_EDIT_SCORE146, m_edtTine103);
	DDX_Control(pDX, IDC_EDIT_SCORE149, m_edtTine104);
	DDX_Control(pDX, IDC_EDIT_SCORE153, m_edtTine105);
	DDX_Control(pDX, IDC_EDIT_SCORE156, m_edtTine106);
	DDX_Control(pDX, IDC_EDIT_SCORE65, m_edtTine107);
	DDX_Control(pDX, IDC_EDIT_SCORE68, m_edtTine108);
	DDX_Control(pDX, IDC_EDIT_SCORE71, m_edtTine109);
	DDX_Control(pDX, IDC_EDIT_SCORE164, m_edtTine110);
	DDX_Control(pDX, IDC_EDIT_SCORE85, m_edtTine111);
	DDX_Control(pDX, IDC_EDIT_SCORE167, m_edtTine112);
	DDX_Control(pDX, IDC_EDIT_SCORE171, m_edtTine113);
	DDX_Control(pDX, IDC_EDIT_SCORE179, m_edtTine114);
	DDX_Control(pDX, IDC_EDIT_SCORE181, m_edtTine115);
	DDX_Control(pDX, IDC_EDIT_SCORE105, m_edtTine116);
	DDX_Control(pDX, IDC_EDIT_SCORE117, m_edtTine117);
	DDX_Control(pDX, IDC_EDIT_SCORE183, m_edtTine118);
	DDX_Control(pDX, IDC_EDIT_SCORE185, m_edtTine119);
	DDX_Control(pDX, IDC_EDIT_SCORE151, m_edtTine120);
	DDX_Control(pDX, IDC_EDIT_SCORE40, m_edtTine121);
	
	DDX_Control(pDX, IDC_EDIT_SCORE2, m_edtTine201);
	DDX_Control(pDX, IDC_EDIT_SCORE50, m_edtTine202);
	DDX_Control(pDX, IDC_EDIT_SCORE147, m_edtTine203);
	DDX_Control(pDX, IDC_EDIT_SCORE150, m_edtTine204);
	DDX_Control(pDX, IDC_EDIT_SCORE154, m_edtTine205);
	DDX_Control(pDX, IDC_EDIT_SCORE159, m_edtTine206);
	DDX_Control(pDX, IDC_EDIT_SCORE66, m_edtTine207);
	DDX_Control(pDX, IDC_EDIT_SCORE69, m_edtTine208);
	DDX_Control(pDX, IDC_EDIT_SCORE72, m_edtTine209);
	DDX_Control(pDX, IDC_EDIT_SCORE165, m_edtTine210);
	DDX_Control(pDX, IDC_EDIT_SCORE86, m_edtTine211);
	DDX_Control(pDX, IDC_EDIT_SCORE168, m_edtTine212);
	DDX_Control(pDX, IDC_EDIT_SCORE178, m_edtTine213);
	DDX_Control(pDX, IDC_EDIT_SCORE180, m_edtTine214);
	DDX_Control(pDX, IDC_EDIT_SCORE182, m_edtTine215);
	DDX_Control(pDX, IDC_EDIT_SCORE115, m_edtTine216);
	DDX_Control(pDX, IDC_EDIT_SCORE124, m_edtTine217);
	DDX_Control(pDX, IDC_EDIT_SCORE184, m_edtTine218);
	DDX_Control(pDX, IDC_EDIT_SCORE186, m_edtTine219);
	DDX_Control(pDX, IDC_EDIT_SCORE155, m_edtTine220);
	DDX_Control(pDX, IDC_EDIT_SCORE41, m_edtTine221);
	
	DDX_Control(pDX, IDC_EDIT_SCORE3, m_cmbTine301);
	DDX_Control(pDX, IDC_EDIT_SCORE48, m_cmbTine302);
	DDX_Control(pDX, IDC_EDIT_SCORE76, m_cmbTine303);
	DDX_Control(pDX, IDC_EDIT_SCORE77, m_cmbTine304);
	DDX_Control(pDX, IDC_EDIT_SCORE78, m_cmbTine305);
	DDX_Control(pDX, IDC_EDIT_SCORE79, m_cmbTine306);
	DDX_Control(pDX, IDC_EDIT_SCORE82, m_cmbTine307);
	DDX_Control(pDX, IDC_EDIT_SCORE83, m_cmbTine308);
	DDX_Control(pDX, IDC_EDIT_SCORE84, m_cmbTine309);
	DDX_Control(pDX, IDC_EDIT_SCORE80, m_cmbTine310);
	DDX_Control(pDX, IDC_EDIT_SCORE87, m_cmbTine311);
	DDX_Control(pDX, IDC_EDIT_SCORE112, m_cmbTine312);
	DDX_Control(pDX, IDC_EDIT_SCORE113, m_cmbTine313);
	DDX_Control(pDX, IDC_EDIT_SCORE145, m_cmbTine314);
	DDX_Control(pDX, IDC_EDIT_SCORE148, m_cmbTine315);
	DDX_Control(pDX, IDC_EDIT_SCORE116, m_cmbTine316);
	DDX_Control(pDX, IDC_EDIT_SCORE125, m_cmbTine317);
	DDX_Control(pDX, IDC_EDIT_SCORE98, m_cmbTine318);
	DDX_Control(pDX, IDC_EDIT_SCORE101, m_cmbTine319);
	DDX_Control(pDX, IDC_EDIT_SCORE161, m_cmbTine320);
	DDX_Control(pDX, IDC_EDIT_SCORE108, m_edtTine321);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBCTinettiBalPage, CDialog)
	//{{AFX_MSG_MAP(CBCTinettiBalPage)
	ON_WM_VSCROLL()
	ON_WM_SIZE()
	ON_WM_MOUSEWHEEL()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBCTinettiBalPage message handlers

void CBCTinettiBalPage::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
	//...

	CScrollPage::OnVScroll(nSBCode, nPos, pScrollBar);
}

void CBCTinettiBalPage::OnSize(UINT nType, int cx, int cy) 
{
	CScrollPage::OnSize(nType, cx, cy);
	
	//...
}

BOOL CBCTinettiBalPage::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) 
{
	//...

	return CScrollPage::OnMouseWheel(nFlags, zDelta, pt);
}

BOOL CBCTinettiBalPage::ClearData()
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	CWnd* apDateLabel[3];
	apDateLabel[0] = GetDlgItem(IDC_STATIC_DATE_1);
	apDateLabel[1] = GetDlgItem(IDC_STATIC_DATE_2);
	apDateLabel[2] = GetDlgItem(IDC_STATIC_DATE_3);

	CWnd* apDiagSNArray[3];
	apDiagSNArray[0] = GetDlgItem(IDC_STATIC_DIAGSN1);
	apDiagSNArray[1] = GetDlgItem(IDC_STATIC_DIAGSN2);
	apDiagSNArray[2] = GetDlgItem(IDC_STATIC_DIAGSN3);
	
	return PageClearData(ppCtrlArray, INPUT_EDIT_CTRL_COUNT, apDateLabel, apDiagSNArray, ARRAY_ELE_COUNT(apDateLabel));
}

int CBCTinettiBalPage::SaveData(CString strMRN, int nDiagSN, BOOL bIsDraft)
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	return PageSaveData(strMRN, nDiagSN, bIsDraft, BODYCHECKSCALEID, ppCtrlArray, INPUT_EDIT_CTRL_COUNT);
}

BOOL CBCTinettiBalPage::ScoreFieldsCheck(LPVOID pParam)
{
	CBCTinettiBalPage* pParent = NULL;
	INPUT_FIELD_INFO* pFieldInfo = (INPUT_FIELD_INFO*)pParam;

	if(pFieldInfo->dwCtrlType == IBT_EditBox)
	{
		CLinkEdit* pEdit = (CLinkEdit*)pFieldInfo->pLinkCtrl;
		if(pEdit)
			pParent = (CBCTinettiBalPage*)pEdit->GetParent();
	}
	else if(pFieldInfo->dwCtrlType == IBT_ComboBox)
	{
		CLinkComboBox* pCombo = (CLinkComboBox*)pFieldInfo->pLinkCtrl;
		if(pCombo)
			pParent = (CBCTinettiBalPage*)pCombo->GetParent();
	}
	else
	{
		ASSERT(FALSE);
	}

	if(pParent == NULL)
	{
		ASSERT(FALSE);
		return FALSE;
	}

	return PageScoreFieldsCheck(pParam, 0, 4, pParent->m_InputFieldArray3, INPUT_EDIT_CTRL_COUNT);
}

BOOL CBCTinettiBalPage::ShowTableDataWithStartCol(CString strMRN, int nDiagSN, int nStartCol)
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;
	
	CWnd* apDateLabel[3];
	apDateLabel[0] = GetDlgItem(IDC_STATIC_DATE_1);
	apDateLabel[1] = GetDlgItem(IDC_STATIC_DATE_2);
	apDateLabel[2] = GetDlgItem(IDC_STATIC_DATE_3);
	
	CWnd* apDiagSNArray[3];
	apDiagSNArray[0] = GetDlgItem(IDC_STATIC_DIAGSN1);
	apDiagSNArray[1] = GetDlgItem(IDC_STATIC_DIAGSN2);
	apDiagSNArray[2] = GetDlgItem(IDC_STATIC_DIAGSN3);
	
	return PageShowTableData(strMRN, nDiagSN, BODYCHECKSCALEID, ppCtrlArray, INPUT_EDIT_CTRL_COUNT, apDateLabel, apDiagSNArray, nStartCol);
}

BOOL CBCTinettiBalPage::ShowTableData(CString strMRN, int nDiagSN)
{
	return ShowTableDataWithStartCol(strMRN, nDiagSN, 2);
}

BOOL CBCTinettiBalPage::EnableInputControls(BOOL bEnable)
{
	INPUT_FIELD_INFO* ppCtrlArray[3];
	ppCtrlArray[0] = m_InputFieldArray1;
	ppCtrlArray[1] = m_InputFieldArray2;
	ppCtrlArray[2] = m_InputFieldArray3;

	return PageEnableInputControls(bEnable, ppCtrlArray, INPUT_EDIT_CTRL_COUNT);
}

BOOL CBCTinettiBalPage::IsPageCurDayBlank()
{
	return CScrollPage::PageIsAllInputBlank(m_InputFieldArray3, INPUT_EDIT_CTRL_COUNT);
}

BOOL CBCTinettiBalPage::SetLastColTitile(CString strDate, int nDiagSN)
{
	CWnd* apDateLabel[3] = {0};
	apDateLabel[2] = GetDlgItem(IDC_STATIC_DATE_3);

	CString astrDate[3];
	astrDate[2] = strDate;
	
	CWnd* apDiagSNArray[3] = {0};
	apDiagSNArray[2] = GetDlgItem(IDC_STATIC_DIAGSN3);

	int anDiagSN[3] = {0};
	anDiagSN[2] = nDiagSN;

	return PageShowColTitle(apDateLabel, astrDate, apDiagSNArray, anDiagSN, ARRAY_ELE_COUNT(apDateLabel));
}
